package nyist.media.entity;

import lombok.Data;
import nyist.media.entity.admin.Admin;
import nyist.media.enums.ApplyStatus;

import javax.persistence.*;

/**
 * 教室借用记录
 *
 * @author : dcf
 * @date : 2019/3/11
 */

@Data
@Entity
@Table(name = "m_p_apply_record")
public class ApplyRecord extends BaseEntity {

    /**
     * 申请人
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "admin_id", columnDefinition = "bigint(11) COMMENT '申请人ID'")
    private Admin admin;

    /**
     * 申请时间
     */
    @Column(columnDefinition = "varchar(30) COMMENT '申请时间'")
    private String applyTime;

    /**
     * 归还时间
     */
    @Column(columnDefinition = "varchar(30) COMMENT '归还时间'")
    private String returnTime;

    /**
     * 申请的教室
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "room_id", columnDefinition = "bigint(11) COMMENT '教室ID'")
    private ClassRoom room;

    /**
     * 申请单的状态
     */
    @Column(columnDefinition = "int(11) COMMENT '0: 申请中 1:申请通过 2:申请失败'")
    private ApplyStatus status;

    /**
     * 是否逾期
     */
    @Column(columnDefinition = "bit(1) COMMENT '是否逾期 true：逾期 false 未逾期'")
    private Boolean overDue;

    /**
     * 驳回理由
     */
    private String rejectedReason;
}